/*
 * Copyright (C) 2016 yixun All Rights Reserved.
 * 
 * ImportStatistics.java
 */
package com.emm.yixun.common.model;
import java.io.Serializable;
import java.math.BigDecimal;

import com.alibaba.fastjson.annotation.JSONField;
import com.emm.yixun.common.utils.MathUtil;

import java.util.Date;

/**
 * [文件名称]<br>
 * ImportStatistics.java<br>
 * <br>
 * [文件描述]<br>
 * 导入统计表 pojo bean<br>
 * <br>
 * [修改记录]<br>
 * 2016-11-15 11:14:13 创建<br>
 * @version 1.00
 */
public class ImportStatisticsSummary implements Serializable{

	/**
	 *总数目
	 */
	private Integer total;
	/**
	 *成功条数
	 */
	private Integer totalSuccessCount;
	/**
	 *失败条数
	 */
	private Integer totalFailCount;
	
	public Integer getTotal() {
		return total;
	}
	public void setTotal(Integer total) {
		this.total = total;
	}
	public Integer getTotalSuccessCount() {
		return totalSuccessCount;
	}
	public void setTotalSuccessCount(Integer totalSuccessCount) {
		this.totalSuccessCount = totalSuccessCount;
	}
	public Integer getTotalFailCount() {
		return totalFailCount;
	}
	public void setTotalFailCount(Integer totalFailCount) {
		this.totalFailCount = totalFailCount;
	}
	public String getSuccessRate() {
		if(null!=this.total && null!=this.totalSuccessCount){
			try {
				if(this.total>0){
					double rateDouble=MathUtil.divide(new BigDecimal(this.totalSuccessCount),new BigDecimal(this.total), 2);
					return String.valueOf(MathUtil.multiply(rateDouble, Double.valueOf("100")));
				}
				
			} catch (Exception e) {
				return "0";
			}
		}
		return "0";
	}

	
    
	
}
